﻿using System;

namespace MathematicallySafe.HeadCounter.Services.Exporters
{
    public class ExporterService: IExportService
    {
        public void Export(ExportType exportType)
        {
            if (exportType == ExportType.Html) ExportHtml();
            if (exportType == ExportType.Lua) ExportLua();
        }

        private void ExportLua()
        {
            var lua = new LuaExport();
            lua.Export();
            OnDataProcessed();
        }

        private void ExportHtml()
        {
            var html = new HtmlExport();
            html.Export();
            OnDataProcessed();
        }

        public event Action Exported;

        private void OnDataProcessed()
        {
            if (Exported != null)
            {
                Exported();
            }
        }
    }
}


